package com.example.consumer.controller;

import com.example.consumer.service.FeignServcie;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author TonySong
 * @date 2024/6/24 0024
 * @time 20:24
 */
@RestController
@RequestMapping("/consumer")
public class IndexController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/t1")
    public String t1(){
        return  "这是消费者,端口："+this.port+"的输出t1";
    }

    @Resource
    private FeignServcie feignServcie;
    @GetMapping("/t2")
    public String test2(){
        //调用生产者
        String hello = this.feignServcie.hello();
        return  "这是消费者,端口："+this.port+"的输出t2"+"----->"+hello;
    }


}
